﻿ <%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Insert title here</title>
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/themes/default/easyui.css" />
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/themes/default/tree.css" />
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/themes/icon.css" />
		<link rel="stylesheet" href="${pageContext.request.contextPath}/css/ainit.css" type="text/css"></link>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.3.min.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.easyui.min.1.3.1.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/locale/easyui-lang-zh_CN.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.json-2.4.min.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.ainit-1.0.0.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/model/js/jquery.ainit-1.1.0.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/model/sysRight/userRight.js"></script>
		
	<script type="text/javascript">
	</script>
	<script type="text/javascript">
		$(function(){
			loadUserCol(); //加载用户列
		}) 
	</script>
	</head>
	<body class="easyui-layout" style="overflow-y: hidden">
		<!-- 用layout 将左右分栏 -->
		 <div data-options="region:'west' "  style="width:270px; height:650px; overflow-y:hidden;" id="taskWest">
 			<div>
				<table class='tableBord' id="caq_commUseU" style="float: left;">
					<tr>
						<td class="name_tdQ" >员工名称：</td>
						<td class="cominput_td" ><input type="text" id='caq_userName'/></td>
					</tr>
				</table>
				<span><a class='easyui-linkbutton' href="#" onclick="_w_bquery(this)" id='caq_taskQuery'  pre='caq' dsid='ds_bs_operators' tit='' flagStr='0' >查询</a></span>
			</div>
			<table cellpadding="0" cellspacing="0" style="padding-top: 5px;">
				<tr>
					<td colspan="2" >
						<!-- 员工列表 -->	
						<table id="caq_USERLIST" ></table>
					</td>
				</tr>
			</table>
		</div>
		<div data-options="region:'center'" style="overflow-y:hidden; height:650px; padding-left: 1px;"  id="cat_QueryTaskList" >  
			<div id="tt" class="easyui-tabs" >  
				 <!-- 弄两个tablib -->
			   <div title="用户组权限" style="overflow:auto;">  
			   	    <div style="height:365px; border-bottom: 1px solid #99BBE8;" id="groupList">
				      <c:forEach items="${m.groupList}" var="glist">
				      	<div style="float: left; cursor: pointer; margin-left: 10px;  width:60px;" gId='${glist.GROUP_ID}' align="center" flag='0' onclick="selColor(this)">
				      		<p align="center"><img src="../model/images/datebox_arrow.png" /></p>
				      		<p>${glist.GROUP_NAME}</p>
				      	</div>
				      </c:forEach>
			   	    </div>
			   	    <div style="height: 30px; border-bottom: 1px solid #99BBE8; padding-top: 3px;" align="right">
			   	    	<a class='easyui-linkbutton' href="#" onclick="groupAdd('groupList','userGroup','0')">添加</a>
			   	    </div>
			        <div style="height: 20px; padding-top: 10px;" >
						<span style="">已授权列表：</span>
					</div> 
					<div style="height: 200px; border: 1px solid #99BBE8; clear: both;">
						<div style="height:150px;  border-bottom: 1px solid #99BBE8;" id="userGroup"></div>
						<div style="height: 30px; border-bottom: 1px solid #99BBE8; padding-top: 3px;" align="right">
				   	    	<a class='easyui-linkbutton' href="#" onclick="groupAdd('userGroup','groupList',1)">移除</a>
				   	    	<a class='easyui-linkbutton' href="#" onclick="groupSave()">保存</a>
				   	    </div>
				  	</div>
			   </div>  
			   <div title="模块权限"  style="overflow:auto;" onSelect="selClick('模块权限')">  
			       <div style="height:365px;border: 1px solid #99BBE8;" id="userModual">
				      <c:forEach items="${m.modelList}" var="mlist" >
				      	<div style="float: left; cursor: pointer; margin-left: 10px; width:60px;" mId='${mlist.menuId }' flag='0' align="center" onclick="selColor(this)">
				      		<p align="center"><img src="../model/images/jindu-no.png" /></p>
				      		<p>${mlist.menuName}</p>
				      	</div>
				      </c:forEach>
			   	    </div>
			   	    <div style="height: 30px; border-bottom: 1px solid #99BBE8; padding-top: 3px;" align="right">
			   	    	<a class='easyui-linkbutton' href="#" onclick="groupAdd('userModual','modualList',0)">添加</a>
			   	    </div>
			        <div style="height: 20px; padding-top: 10px;" >
						<span style="">已授权列表：</span>
					</div> 
					<div style="height: 200px; border: 1px solid #99BBE8; clear: both;">
						<div style="height:150px;  border-bottom: 1px solid #99BBE8; " id="modualList"></div>
						<div style="height: 30px; border-bottom: 1px solid #99BBE8; padding-top: 3px;" align="right">
				   	    	<a class='easyui-linkbutton' href="#" onclick="groupAdd('modualList','userModual',2)">移除</a>
				   	    	<a class='easyui-linkbutton' href="#" onclick="modualSave()">保存</a>
				   	    </div>
				  	</div>
			   </div> 
			   <div title="功能权限"  style="overflow:auto;" >  
			        <div style="height:400px;border: 1px solid #99BBE8;">
				       <!-- 加载所有的菜单 -->
				        <div id="leftModel" style="float: left; width:100px; height:100%; border-right: 1px solid #99BBE8;"  >
				        	<c:forEach items="${m.modelList}" var="mlist" >
					      		<div style=" cursor: pointer;" flag='0' onclick="selColorLeft(this)" mId='${mlist.menuId }'>
						      		<p><img src="../model/images/jindu-no.png" />${mlist.menuName}</p>
					      		</div>  
				      		</c:forEach>
				        </div>
				        <div style="height: 100%;">
				        	<div id="dsByleft" style="height: 92%; border-bottom: 1px solid #99BBE8;"><!-- 加载模块对应的功能菜单 --></div>
				        	<div style="padding-left: 10px; padding-top: 3px;">
				        		<input type="radio" name="yorn" value="0" checked="checked"/>允许
				        		<input type="radio" name="yorn" value="1"/>拒绝&nbsp;&nbsp;
				        		<a class='easyui-linkbutton' href="#" onclick="gnAdd()">添加</a>
				        	</div>
				        </div>
			   	    </div>
			        <div style="height: 20px; padding-top: 10px;" >
						<span style="">已授权列表：</span>
					</div> 
					<div style="height: 200px; border: 1px solid #99BBE8; clear: both;"> 
						<div style="height:150px;  border-bottom: 1px solid #99BBE8;" id="haveDs"></div>
						<div style="height: 30px; border-bottom: 1px solid #99BBE8; padding-top: 3px;" align="right">
				   	    	<a class='easyui-linkbutton' href="#" onclick="gnDel()">移除</a>
				   	    	<a class='easyui-linkbutton' href="#" onclick="contraryAuthority('haveDs')">反权限</a>
				   	    	<a class='easyui-linkbutton' href="#" onclick="gnSave()">保存</a>
				   	    </div>
				  	</div>
			   </div> 
			   <div title="按钮权限"  style="overflow:auto;" onSelect="optChangeDs('按钮权限')" >  
			       <div style="height:400px;border: 1px solid #99BBE8;">
			        	<div id="leftDS" style="float: left; width:120px; height:100%; border-right: 1px solid #99BBE8;"  >
				        	<div id="leftDSMod" style="height: 30px;border-bottom: 1px solid #99BBE8;"><!-- 存放一个存放模块的下拉框 -->
				        		<div style="padding-top: 5px;">
				        			模块:
				        			<select id="butnMoSel" onchange="optChangeDs('')" style="width:84px;">
					        			<c:forEach items="${m.modelList}" var="dl" begin="0" end="0">
					        				<option value="${dl.menuId}"  selected="selected">${dl.menuName}</option>
					        			</c:forEach>
					        			<c:forEach items="${m.modelList}" var="dl" begin="1" >
					        				<option value="${dl.menuId}" >${dl.menuName}</option>
					        			</c:forEach>
				        			</select>
				        		</div>
				        	</div>
							<div id="leftDSByMod" style="float: left; width: 100%;"  >
					        	<c:forEach items="${m.dataStroeList}" var="dlist" >
						      		<div style=" cursor: pointer; width: 100%;" flag='0'  onclick="selDSLeft(this)" dsId='${dlist.DS_ID}'>
							      		<p><img src="../model/images/jindu-row.png" />${dlist.DS_NAME}</p>
						      		</div>  
					      		</c:forEach>
				        	</div>
				        </div>
				         <div style="height: 100%;">
				        	<div id="butByleft" style="height: 92%; border-bottom: 1px solid #99BBE8;"><!-- 加载功能对应的按钮--></div>
				        	<div style="padding-left: 10px; padding-top: 3px;">
				        		<input type="radio" name="yorj" value="0" checked="checked"/>允许
				        		<input type="radio" name="yorj" value="1"/>拒绝&nbsp;&nbsp;
				        		<a class='easyui-linkbutton' href="#" onclick="butnAdd()">添加</a>
				        	</div>
				        </div>
			   	   </div>
			        <div style="height: 20px; padding-top: 10px;" >
						<span style="">已授权列表：</span>
					</div>  
					<div style="height: 200px; border: 1px solid #99BBE8; clear: both;">
						<div style="height:150px;  border-bottom: 1px solid #99BBE8;" id="haveButn"></div>
						<div style="height: 30px; border-bottom: 1px solid #99BBE8; padding-top: 3px;" align="right">
				   	    	<a class='easyui-linkbutton' href="#" onclick="butnDel()">移除</a>
				   	    	<a class='easyui-linkbutton' href="#" onclick="contraryAuthority('haveButn')">反权限</a>
				   	    	<a class='easyui-linkbutton' href="#" onclick="butnSave()">保存</a>
				   	    </div>
				  	</div>
			   </div> 
			   <div title="数据范围权限"  style="overflow:auto;">  
			       <div style="height:620px;border: 1px solid #99BBE8;">
				       <!-- 加载所有的菜单 -->
				        <div id="leftModelData" style="float: left; width:100px; height:100%; border-right: 1px solid #99BBE8;"  >
				        	<c:forEach items="${m.modelList}" var="mlist" >
					      		<div style=" cursor: pointer;" flag='0' onclick="selMoForAllDs(this)" mId='${mlist.menuId }'>
						      		<p><img src="../model/images/jindu-no.png" />${mlist.menuName}</p>
					      		</div>  
				      		</c:forEach>
				        </div>
				        <div style="height: 100%;">
				        	<div id="dsDataSql" style="height: 92%;"><!--  border-bottom: 1px solid #99BBE8; -->
				        		<div id="dsByleftData" style="height:60%; border-bottom: 1px solid #99BBE8;"><!-- 加载ds -->
				        		
				        		</div>
				        		<div style="height: 20px;" >
									<span style="">原始SQL：</span>
								</div> 
				        		<div id="sqlRight">
				        			<textarea rows="4" cols="170" id="sqlTextDS" readonly="readonly"></textarea>
				        		</div>
				        		<div style="height: 20px; " >
									<span style="">SQL条件输入框：</span>
								</div> 
				        		<div id="sqlRight">
				        			<textarea rows="4" cols="170" id="sqlTextArea"></textarea>
				        		</div>
				        	</div>
				        	<div style="padding-left: 10px; padding-top: 3px;border-bottom: 1px solid #99BBE8;">
				   	    		<a class='easyui-linkbutton' href="#" onclick="saveWhereSql()">保存</a>
				   	   	 	</div>
<!--				        	<div style="padding-left: 10px; padding-top: 3px;">-->
<!--				        		<a class='easyui-linkbutton' href="#" onclick="testSQL()">SQL测试</a>-->
<!--				        	</div>-->
				        </div>
			   	    </div>
<!--					<div style="height: 200px; border-bottom:  1px solid #99BBE8; clear: both;">-->
<!--						<div style="height:160px;  border-bottom: 1px solid #99BBE8;" id="sqlResult">测试结果显示：</div>-->
<!--						<div style="height: 30px; border-bottom: 1px solid #99BBE8; " align="right">-->
<!--				   	    	<a class='easyui-linkbutton' href="#" onclick="">保存</a>-->
<!--				   	    </div>-->
<!--				  	</div>-->
			   </div> 
			</div>
			
        </div>
		<input type="hidden" id='zab_sq_pks'/>
		<input type="hidden" id="zab_dsId" value="${m.dsId}"/>
	</body>
</html>